<?php
/**
 * 后台地图
 */

class Public_MapController extends Cms_AdminController {
	
	/**
	 * 初始化
	 *
	 */
	public function init() {
		parent::init ();
	}
	
	public function indexAction() {
		
		$array = Model_Menu::admin_menu ( 0 );
		$map = "";
		$n = 1;
		foreach ( $array as $k => $v ) {
			if ($n == 1) {
				$map .= "<div class=\"map-menu lf\">";
			}
			$map .= "<ul>";
			$map .= "<li class=\"title\">{$v['name']}</li>";
			$childmenus = Model_Menu::admin_menu ( $v ['id'] );
			foreach ( $childmenus as $key => $r ) {
				$map .= "<li class=\"title2\">{$r['name']}</li>";
				$menus = Model_Menu::admin_menu ( $r ['id'] );
				foreach ( $menus as $s => $r ) {
					$map .= "<li><a href=\"javascript:Go({$r['id']},'{$r['controller']}')\">{$r['name']}</a></li>";
				}
			}
			$map .= "</ul>";
			if ($n % 2 == 0) {
				$map .= "</div><div class=\"map-menu lf\">";
			}
			$n ++;
		}
		
		$this->view->assign ( 'map', $map );
		$this->render ( 'Public/map/index', null, true );
	}
}
?>